home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / free_browsing / DavesQckSearchDbar3-14 / dqsd.exe / searches / gg.xml < prev    next >
Text File  |  2002-09-10  |  12KB  |  298 lines

  1. <search function="gg">
  2.   <name>Google</name>
  3.   <description>
  4.     Google is reputed to be the web's fastest and most versatile search engine.<br/>
  5.     <div class="helpboxDescLabels">Switches:</div>
  6.     <table class="helpboxDescTable">
  7.       <tr><td>/ifl</td><td> - </td><td>"I'm Feeling Lucky": Go directly to Google's top-ranked result.</td></tr>
  8.       <tr><td>/advanced</td><td> - </td><td>Use the Google Advanced Search page.</td></tr>
  9.       <tr><td>/groups</td><td> - </td><td>Search Google's newsgroup archive.</td></tr>
  10.       <tr><td>/directory</td><td> - </td><td>Search Google's copy of the DMOZ open directory.</td></tr>
  11.       <tr><td>/images</td><td> - </td><td>Search for images.</td></tr>
  12.       <tr><td>/news</td><td> - </td><td>Search for news (<i>warning : google news still in beta, .com only, english only mode</i>).</td></tr>
  13.       <tr><td>/since:days</td><td> - </td><td>Search pages based on when they were indexed.  Use either a number to specify when, or 
  14.         <div style="padding: 0 0 0 20px">
  15.           /since:t - indexed today<br/>   
  16.           /since:y - indexed yesterday<br/>   
  17.           /since:w - indexed in the last 7 days<br/>   
  18.           /since:m - indexed in the last 30 days   
  19.         </div> 
  20.       </td></tr>
  21.       <tr><td>/cache</td><td> - </td><td>Given a URL, loads Google's cached copy of the web page.</td></tr>
  22.       <tr><td>/related</td><td> - </td><td>Given a URL, finds other sites closely related.</td></tr>
  23.       <tr><td>/link</td><td> - </td><td>Given a URL, finds other sites that link to it.</td></tr>
  24.     </table>
  25.     <div class="helpboxDescLabels">Locales:</div>
  26.     <table class="helpboxDescTable">
  27.       <tr><td>/local</td><td> - </td><td>Limits search results to the specified locale.</td></tr>
  28.       <tr><td>/canada</td><td> - </td><td>Use the localized canadian version of Google.</td></tr>
  29.       <tr><td>/deutschland</td><td> - </td><td>Use the localized german version of Google.</td></tr>
  30.       <tr><td>/france</td><td> - </td><td>Use the localized french version of Google.</td></tr>
  31.       <tr><td>/italia</td><td> - </td><td>Use the localized italian version of Google.</td></tr>
  32.       <tr><td>/uk</td><td> - </td><td>Use the localized United Kingdom version of Google.</td></tr>
  33.     </table>
  34.     <div class="helpboxDescLabels">Language:</div>
  35.     <table class="helpboxDescTable">
  36.       <tr><td colspan="3">Display Google tips and messages in...</td></tr>
  37.       <tr><td>/language:de</td><td> - </td><td>german</td></tr>
  38.       <tr><td>/language:es</td><td> - </td><td>spanish</td></tr>
  39.       <tr><td>/language:fr</td><td> - </td><td>french</td></tr>
  40.       <tr><td>/language:it</td><td> - </td><td>italian</td></tr>
  41.       <tr><td colspan="3">and many more... see <a href="http://www.google.com/help/customize.html#displang" target="_new">www.google.com/help/customize.html#displang</a></td></tr>
  42.     </table>
  43.     <div class="helpboxDescLabels">Examples:</div>
  44.     <table class="helpboxDescTable">
  45.       <tr><td>gg dqsd /images</td></tr>
  46.       <tr><td>gg tony blair /uk /directory</td></tr>
  47.     </table>
  48.   </description>
  49.   <category>Search the Web</category>
  50.   <link>http://www.google.com/</link>
  51.   <contributor>Ryan Edwards, David Bau, news and language switches by MLL</contributor>
  52.   
  53.   <form name="ggf"
  54.         action="http://www.google.com/search"
  55.         method="get">
  56.     <input type="hidden" name="hl" value=""/>
  57.     <input type="hidden" name="cat" value=""/>
  58.     <input type="hidden" name="meta" value=""/>
  59.     <input type="hidden" name="q"/>
  60.   </form>
  61.   
  62.   <form name="ggf_adv"
  63.         action="http://www.google.com/advanced_search"
  64.         method="get">
  65.     <input type="hidden" name="hl" value=""/>
  66.     <input type="hidden" name="q"/>
  67.   </form>
  68.   
  69.   <form name="ggf_ifl"
  70.         action="http://www.google.com/search"
  71.         method="get">
  72.     <input type="hidden" name="hl" value=""/>
  73.     <input type="hidden" name="q"/>
  74.     <input type="hidden" name="meta" value=""/>
  75.     <input type="hidden" name="btnI" value="I'm Feeling Lucky"/>
  76.   </form>
  77.   
  78.   <form name="ggf_image"
  79.         action="http://images.google.com/images"
  80.         method="get">
  81.     <input type="hidden" name="hl" value=""/>
  82.     <input type="hidden" name="q"/>
  83.   </form>
  84.   
  85.   <form name="ggf_groups"
  86.         action="http://groups.google.com/groups"
  87.         method="get">
  88.     <input type="hidden" name="hl" value=""/>
  89.     <input type="hidden" name="q"/>
  90.   </form>
  91.   
  92.   <form name="ggf_news"
  93.         action="http://news.google.com/news"
  94.         method="get">
  95.     <!-- commented out for test <input type="hidden" name="hl" value="en"/> -->
  96.     <input type="hidden" name="hl" value=""/>
  97.     <input type="hidden" name="q"/>
  98.   </form>
  99.   
  100.   <form name="ggf_fresh"
  101.         action="http://www.researchbuzz.com/cgi-bin/goofresh.cgi" 
  102.         method="get">
  103.     <input type="hidden" Name="query" />
  104.     <input type="hidden" name="datemod" value="0" />
  105.   </form>
  106.  
  107.  
  108.   <script><![CDATA[
  109.  
  110.  
  111.     function julian(Y,M,D) {
  112.     //inspired from http://pacific.commerce.ubc.ca/xr/julian.html
  113.     //(did not check it toroughly, but seems to work)
  114.        with (Math) {
  115.          jd=367*Y-floor(7*(Y+floor((M+9)/12))/4)
  116.            -floor(3*(floor((Y+(M-9)/7)/100)+1)/4)
  117.            +floor(275*M/9)+D+1721028;
  118.        }
  119.        return jd;
  120.     }
  121.  
  122.  
  123.     function gg(q)
  124.     //by MLL: warning : news service is still in beta stage, so URLs below may change
  125.     {
  126.       var args = parseArgs(q, "ifl, advanced, groups, directory, images, news, since, cache, related, link, local, canada, deutschland, france, italia, uk, language");
  127.       var mode, local, local_meta = "", local_tld = "com", msglang = "";
  128.       
  129.       if( nullArgs( "gg", args.q ) ) return false;
  130.       
  131.       // Establish the locale and mode the search will run in.
  132.       if( args.switches.length > 0 )
  133.       {
  134.         for( var j=0; j<args.switches.length; j++ )
  135.         {
  136.           switch( args.switches[j].name )
  137.           {
  138.             case "canada": local_tld = "ca"; local_meta = "cr=countryCA"; break;
  139.             case "deutschland": local_tld = "de"; local_meta = "cr=countryDE"; break;
  140.             case "france": local_tld = "fr"; local_meta = "cr=countryFR"; break;
  141.             case "italia": local_tld = "it"; local_meta = "cr=countryIT"; break;
  142.             case "uk": local_tld = "co.uk"; local_meta = "cr=countryUK|countryGB"; break;
  143.             
  144.             case "local": local = true; break;
  145.             
  146.             case "language": msglang = args.switch_val["language"]; break;
  147.             case "since": break;
  148.             
  149.             default:
  150.               if(mode) 
  151.               { 
  152.                 nullArgs("gg","?"); 
  153.                 return false; 
  154.               } 
  155.               else
  156.                 mode = args.switches[j].name;
  157.               break;
  158.           }
  159.         }
  160.       }
  161.       
  162.       // Change the form data to use the correct locale
  163.       document.ggf.action = document.ggf_ifl.action = "http://www.google." + local_tld + "/search";
  164.       document.ggf_adv.action = "http://www.google." + local_tld + "/advanced_search";
  165.       document.ggf_image.action = "http://images.google." + local_tld + "/images";
  166.       document.ggf_groups.action = "http://groups.google." + local_tld + "/groups";
  167.       document.ggf_news.action = "http://news.google." + local_tld + "/news";
  168.       
  169.       // If the user specified to search localized content only, restrict it now.
  170.       if(local)
  171.         document.ggf.meta.value = document.ggf_ifl.meta.value = local_meta;
  172.       else
  173.         document.ggf.meta.value = document.ggf_ifl.meta.value = "";
  174.       
  175.       // No parameters, so go to the appropriate web page.
  176.       if( args.q == "" )
  177.         switch( mode )
  178.         {
  179.           case "ifl": openSearchWindow("http://www.google." + local_tld + "/help/features.html#lucky"); return;
  180.           case "advanced": openSearchWindow("http://www.google." + local_tld + "/advanced_search"); return;
  181.           case "images": openSearchWindow("http://images.google." + local_tld); return;
  182.           case "directory": openSearchWindow("http://images.google." + local_tld + "/dirhp"); return;
  183.           case "groups": openSearchWindow("http://www.google." + local_tld + "/grphp"); return;
  184.           case "news": openSearchWindow("http://www.google." + local_tld + "/news"); return;
  185.           default: openSearchWindow("http://www.google." + local_tld); return;
  186.         }
  187.       
  188.       else
  189.       {
  190.         //apply the daterange specification
  191.         if( args.switch_val["since"] == "" )
  192.         {
  193.           nullArgs("gg","?");
  194.           return false;
  195.         }
  196.         if( typeof args.switch_val["since"] != "undefined" )
  197.         {
  198.           var today = new Date();
  199.           var todayj = julian(today.getYear(),today.getMonth()+1,today.getDate());
  200.           var deltadays;
  201.           switch ( args.switch_val["since"] )
  202.           {
  203.             case "t": deltadays = 0; break;
  204.             case "y": deltadays = 1; break;
  205.             case "w": deltadays = 7; break;
  206.             case "m": deltadays = 30; break;
  207.             default: deltadays = args.switch_val["since"]; break;
  208.            }
  209.           if( isNaN(deltadays) )
  210.           {
  211.             nullArgs("gg","?");
  212.             return false;
  213.           }
  214.           var sincej = todayj - deltadays;
  215.           args.q = args.q + " daterange:" + sincej + "-" + todayj;
  216.         }
  217.  
  218.         if( mode )
  219.         {
  220.           // Perform a validity check on the specified switch
  221.           if((mode == "related" || mode == "cache" || mode == "link") && !isURL(args.q))
  222.           {
  223.             nullArgs("gg","?"); 
  224.             return false;
  225.           }
  226.  
  227.           switch( mode )
  228.           {
  229.             case "ifl":
  230.               document.ggf_ifl.q.value = args.q;
  231.               document.ggf_ifl.hl.value = msglang;
  232.               submitForm(ggf_ifl);
  233.               break;
  234.             case "advanced":
  235.               document.ggf_adv.q.value = args.q;
  236.               document.ggf_adv.hl.value = msglang;
  237.               submitForm(ggf_adv);
  238.               break;
  239.             case "directory":
  240.               document.ggf.q.value = args.q;
  241.               document.ggf.hl.value = msglang;
  242.               document.ggf.cat.value = "gwd/Top";
  243.               submitForm(ggf);
  244.               break;
  245.             case "images":
  246.               document.ggf_image.q.value = args.q;
  247.               document.ggf_image.hl.value = msglang;
  248.               submitForm(ggf_image);
  249.               break;
  250.             case "related":
  251.               document.ggf.q.value="related:" + args.q;
  252.               document.ggf.hl.value = msglang;
  253.               document.ggf.cat.value = "";
  254.               submitForm(ggf);
  255.               break;
  256.             case "cache":
  257.               document.ggf.q.value="cache:" + args.q;
  258.               document.ggf.hl.value = msglang;
  259.               document.ggf.cat.value = "";
  260.               submitForm(ggf);
  261.               break;
  262.             case "link":
  263.               document.ggf.q.value="link:" + args.q;
  264.               document.ggf.hl.value = msglang;
  265.               document.ggf.cat.value = "";
  266.               submitForm(ggf);
  267.               break;
  268.             case "groups":
  269.               document.ggf_groups.q.value = args.q;
  270.               document.ggf_groups.hl.value = msglang;
  271.               submitForm(ggf_groups);
  272.               break;
  273.             case "news":
  274.               document.ggf_news.q.value = args.q;
  275.               document.ggf_news.hl.value = msglang;
  276.               submitForm(ggf_news);
  277.               break;
  278.           }
  279.         }
  280.         else
  281.         {
  282.           document.ggf.q.value = args.q;
  283.           document.ggf.hl.value = msglang;
  284.           document.ggf.cat.value = "";
  285.           submitForm(ggf);
  286.         }
  287.       }
  288.     }
  289.   ]]></script>
  290.  
  291.   <copyright>
  292.     Copyright (c) 2002 David Bau
  293.     Distributed under the terms of the
  294.     GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  295.   </copyright>
  296. </search>
  297.  
  298.